Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- auto vaccum이 되었던 시간과 개수 | |
select relname, autovacuum_count, last_autovacuum::timestamp with time zone at time zone 'Asia/Seoul' from pg_stat_all_tables where last_autovacuum is not null order by last_autovacuum desc limit 20; | |
-- 현재 실행중인 query | |
SELECT pid,query,now()-query_start as diff,query_start,state_change FROM pg_stat_activity where state='active' order by query_start desc; | |
-- 실행중인 pid kill | |
SELECT pg_terminate_backend( | |
--pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# recursively removes all .pyc files and __pycache__ directories in the current | |
# directory | |
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CancelableThreadTask | |
{ | |
private Thread? _thread; | |
private readonly Action _action; | |
private readonly Action<Exception>? _onError; | |
private readonly Action? _onCompleted; | |
private TaskCompletionSource? _tcs; | |
private int _isRunning = 0; |
首先需要明确的是 MixupDetection
这个类是在 VOCDetection
类之上的一个 wrapper,因为 mixup 这个技巧/方法可以简单的认为是一个 Data Augmentation 的手段。传统的 Data Augmentation 手段:裁剪、翻转 / 旋转、尺度变化,mixup 的做法在于将两幅图像按照随机权重相加。
MixupDetection
的实现考虑了两幅图像的大小可能是不同的,因此 mixup 后的图像为最大的图像,因此代码中 mixup 图像由下得到
height = max(img1.shape[0], img2.shape[0])
width = max(img1.shape[1], img2.shape[1])
mix_img = mx.nd.zeros(shape=(height, width, 3), dtype='float32')
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$CurrentState = $null | |
$NewState = $null | |
Write-Host "Monitoring device changes..." -ForegroundColor Green | |
while ($true) { | |
if (-not($CurrentState)) { | |
$CurrentState = Get-PnpDevice -Status OK | |
} | |
else { | |
$NewState = Get-PnpDevice -Status OK | |
$Changes = $null |
- No proxy for:
*.apache.org, *.github.com, *.github.io, *.githubusercontent.com, *.gitlab.com, *.google.com, *.gradle.org, *.jetbrains.space, *.maven.org, *.micronaut.io, *.quarkus.io, *.scala-sbt.org, *.schemastore.org, *.spring.io, cache-redirector.jetbrains.com, cloudconfig.jetbrains.com, download-cdn.jetbrains.com, download.jetbrains.com, downloads.marketplace.jetbrains.com, ea-report.jetbrains.com, github.com, gitlab.com, google.com, gradle.org, jcenter.bintray.com, jitpack.io, micronaut.io, plugins.jetbrains.com, quarkus.io, repo.papermc.io, resources.jetbrains.com, spring.io, www.jetbrains.com
Activation Key:
UX394X3HLT-eyJsaWNlbnNlSWQiOiJVWDM5NFgzSExUIiwibGljZW5zZWVOYW1lIjoiSG9uZ2lrIFVuaXZlcnNpdHntmY3snbXrjIDtlZnqtZAiLCJsaWNlbnNlZVR5cGUiOiJDTEFTU1JPT00iLCJhc3NpZ25lZU5hbWUiOiLkvJfliJvkupEg5bel5L2c5a6kIiwiYXNzaWduZWVFbWFpbCI6ImhhbmF6YXdhbWl0b0BnbWFpbC5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class RD_Text_Extraction | |
* | |
* Example usage: | |
* | |
* $response = RD_Text_Extraction::convert_to_text($path_to_valid_file); | |
* | |
* For PDF text extraction, this class requires the Smalot\PdfParser\Parser class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tiktoken | |
import langdetect | |
T = tiktoken.get_encoding("o200k_base") | |
length_dict = {} | |
for i in range(T.n_vocab): | |
try: | |
length_dict[i] = len(T.decode([i])) | |
except: |
NewerOlder